import React from 'react';
import AlbumOutlined from '@material-ui/icons/AlbumOutlined';
import { NavView, get_mod, NavListSub, loc } from 'sui';
import { PairView } from './pair';
import { TryView } from './try';
import { AutoView } from './auto/view';
import { GroupAny } from './group/any';
import { GroupPair } from './group/pair';

const model = (cfg) => {
    const fix = [
        {uid: "pair.try", view: TryView, value: loc("l_874")},
        {uid: "pair.hand", view: PairView, value: loc("l_736")},
        {uid: "pair.any", view: GroupAny, value: loc("l_742")},
        {uid: "pair.pair", view: GroupPair, value: loc("l_744")},
        {uid: "pair.auto", view: AutoView, value: loc("l_737")},
    ];

    return get_mod(cfg, fix, "pair");
};

const Pair = ({ mod, cfg }) => <NavView cfg={cfg} model={model(cfg)} mod={mod} name="pair"/>;

const NavPair = (props) => <NavListSub icon={<AlbumOutlined/>} sub={model(props.cfg)} {...props}/>;

export {NavPair, Pair};
